IDL_Object

The IDL_Object class is designed to be inherited by objects that define _overload methods, in order to overload the behavior of one or more of IDL’s standard operators. It is not meant to be instantiated directly.

To overload the behavior of a standard operator for objects of a user-defined object class, you would write an overloaded operator method for the class, and add IDL_Object as a superclass of the class. Object classes that do not inherit from the IDL_Object class do not use operator overload methods even if the methods are defined.

Object classes that inherit from the IDL_Object class can also overload several routines that provide information about variables: HELP, PRINT, and SIZE.

Note: The INIT and CLEANUP methods for a subclass do not need to call this superclass' INIT and CLEANUP methods.

Superclasses

None

Creation

This class serves as an interface class for other classes. There is never a need to instantiate an IDL_Object class directly.

Properties

The following properties are used to return the variable attributes for the object. You can subclass the GetProperty method and return different values for these properties.

DIM

By default, calls the ::_overloadSize method and returns an array containing the dimensions.

LENGTH

By default, calls the ::_overloadSize method and returns an integer giving the number of elements.

NDIM

By default, calls the ::_overloadSize method and returns an integer giving the number of dimensions.

TNAME

By default, returns "OBJREF".

TYPECODE

By default, returns 11 (the type code for objects).

TYPENAME

By default, returns the class name for the object.

TYPESIZE

By default, returns 4 (the number of bytes for an object reference).

Methods

This class defines methods for each standard IDL operator that can be overloaded.

This class has the following methods:

Example

A user-defined class that overloads one or more operators must include the INHERITS token in the class structure definition:

PRO myObjectClass__define

structure = { myObjectClass, $

              PROPERTY1: 0L, $

              PROPERTY2: '', $

              INHERITS IDL_Object $

            }

END

Version History

8.0

Introduced

8.3 Added ::_overloadImpliedPrint

8.4

Added ::GetProperty method with Variable Attributes

8.4.1

Added ::_overloadPlusPlus, ::_overloadMinusMinus, ::_overloadPostIncrementCopy

8.5 Added ::_overloadFunction and ::_overloadMethod

See Also

IDL_Variable